<script src="<%= themeConfig.domain %>/media/scripts/_core/plugins.js"></script>
<script src="<%= themeConfig.domain %>/media/scripts/_core/custom.js"></script>

<!-- highlight -->
<script src="https://cdn.bootcss.com/highlight.js/9.15.8/highlight.min.js"></script>
<!-- Md5 Min JS -->
<script src="<%= themeConfig.domain %>/media/scripts/_vendors/md5.min.js"></script>

<script type="application/javascript">
    // 代码高亮
    hljs.initHighlightingOnLoad();

</script>

<% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %>

    <% if (commentSetting.commentPlatform === 'gitalk') { %>
        <script src="https://cdn.bootcss.com/gitalk/1.5.0/gitalk.min.js"></script>
        <script>

            var gitalk = new Gitalk({
                clientID: '<%= commentSetting.gitalkSetting.clientId %>',
                clientSecret: '<%= commentSetting.gitalkSetting.clientSecret %>',
                repo: '<%= commentSetting.gitalkSetting.repository %>',
                owner: '<%= commentSetting.gitalkSetting.owner %>',
                admin: ['<%= commentSetting.gitalkSetting.owner %>'],
                id: md5(location.pathname),      // Ensure uniqueness and length less than 50
                distractionFreeMode: false  // Facebook-like distraction free mode
            })

            gitalk.render('gitalk-container')

        </script>
    <% } %>

    <% if (commentSetting.commentPlatform === 'disqus') { %>
        <script src="https://unpkg.com/disqusjs@1.1/dist/disqus.js"></script>
        <script>

            var options = {
                shortname: '<%= commentSetting.disqusSetting.shortname %>',
                apikey: '<%= commentSetting.disqusSetting.apikey %>',
            }
            if ('<%= commentSetting.disqusSetting.api %>') {
                options.api = '<%= commentSetting.disqusSetting.api %>'
            }
            var dsqjs = new DisqusJS(options)

        </script>
    <% } %>

<% } %>

